package Tranasctional;

import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

public class B {
    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = {Exception.class, RuntimeException.class})
    public String B1(){

        System.out.println("哈哈哈");
        return "哈哈";
    }

    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = {Exception.class, RuntimeException.class})
    public void B2(String c){
//    int b = 10/0;
        System.out.println(c+"嘿嘿嘿");
    }
}
